<?php $orderId=$this->id; ?>
	<div class="dbgrid_center_right" style="overflow-x:scroll;width:95%">
		<table cellpadding="0" cellspacing="0">
		    <tr>
                <td class="dbgrid_th">
	                <span class='center_form_btn_text'>
	                   <input type='button' value='<?php echo $this->translate("addNewPackage"); ?>' id="add1" name="add1" onclick="javascript:Order.openPackageDialog('<?php echo HttpUtil::baseUrl();?>', '<?php echo  $orderId; ?>');">
	                </span>
                </td>
		        <td class="dbgrid_th"><span><?php echo $this->translate("sku"); ?></span></td>
		        <td class="dbgrid_th"><span><?php echo $this->translate("product"); ?></span></td>
		        <td class="dbgrid_th"><span><?php echo $this->translate("attribute"); ?></span></td>
		        <td class="dbgrid_th"><span><?php echo $this->translate("qty"); ?></span></td>
		        <td class="dbgrid_th"><span><?php echo $this->translate("place"); ?></span></td>
                <!--<td class="dbgrid_th"><span><?php echo $this->translate("action"); ?></span></td>-->
		        <?php 
		         if(!empty($this->packages)){
		         		foreach ($this->packages as $package) { 
		        ?>
                <td class="dbgrid_th"><span><?php echo $this->translate("package"); ?><br	/><?php echo $package['tracking_num'] ?></span></td>
                <?php 
                		} 
                  } 
                ?>
		    </tr>
                <?php 
                if (!empty($this->items)){
		   			 foreach ($this->items as $item) :
		   		?>
		    <tr>
                <td class="dbgrid_td"><div><input type="checkbox" name="packageitems" value="<?php echo $item['oiid']; ?>"/></div></td>
		        <td class="dbgrid_td"><?php echo $item['sku']; ?></td>
		        <td class="dbgrid_td"><?php echo $item['title']; ?></td>
		        <td class="dbgrid_td">
                <?php if (! empty($item['value_1'])) {?>
                <span><div align="center"><?php echo $item['attribute_1']; ?>:<label><?php echo $item['value_1']; ?></label></div></span>
                <?php } ?>
                <?php if (! empty($item['value_2'])) {?>
                <span><div align="center"><?php echo $item['attribute_2']; ?>:<label><?php echo $item['value_2']; ?></label></div></span>
                <?php } ?>
                <?php if (! empty($item['value_3'])) {?>
                <span><div align="center"><?php echo $item['attribute_3']; ?>:<label><?php echo $item['value_3']; ?></label></div></span>
                <?php } ?>
                <?php if (! empty($item['value_4'])) {?>
                <span><div align="center"><?php echo $item['attribute_4']; ?>:<label><?php echo $item['value_4']; ?></label></div></span>
                <?php } ?>
                <?php if (! empty($item['value_5'])) {?>
                <span><div align="center"><?php echo $item['attribute_5']; ?>:<label><?php echo $item['value_5']; ?></label></div></span>
                <?php } ?>
                </td>
		        <td class="dbgrid_td"><?php echo $item['quantity']; ?></td>
		        <td class="dbgrid_td"><?php echo OrderConstant::getPlace($item['place']); ?></td>
		        <!--<td class="dbgrid_td">&nbsp;
                    <span >
                    	<?php if($item['status'] == 0){ ?>
                    		<input type='button'  value="cancel"  id='cancel1'  name='cancel1' onclick="javascript:Order.cancelItemDialog('<?php echo HttpUtil::baseUrl(); ?>', '<?php echo  $item['id']; ?>')" />
                    	<?php } else { echo OrderConstant::getItemStatus($item['status']); } ?>
                	</span>
                </td>-->
                <?php 
		         if(!empty($this->packages)){
		         		foreach($this->packages as $key=>$package) { 
		         			
		        ?>
		        <td class="dbgrid_td">
		        	<?php 
		       			 if(isset($package['item'][$item['oiid']])){
		       			 	echo $package['item'][$item['oiid']];
		       			 } else {
		       			 	//echo 0;
		       			 }
		        	
		       		 ?>
	        	</td> 
		        <?php 
                		} 
                  } 
                ?>      
		    </tr>
             <?php 
		   			 endforeach; 
		       }
		     ?>
		     <tr>
		     	<td class="dbgrid_td" colspan=6>&nbsp;</td>
		     	<?php 
		         if(!empty($this->packages)){
		         		foreach($this->packages as $key=>$package) { 
		        ?>
		        <td class="dbgrid_td">
		        		<?php echo OrderConstant::getPackageStatus($package['status']) ?>
	        	</td> 
		        <?php 
                		} 
                  } 
                ?>   
		     </tr>	 
		     <tr>
		     	<td class="dbgrid_td" colspan=6>&nbsp;</td>
		     	<?php 
		         if(!empty($this->packages)){
		         		foreach($this->packages as $key=>$package) { 
		        ?>
		        <td class="dbgrid_td">
		        	 <input type="button" name="edit" value="<?php echo $this->translate("editBtn"); ?>" id="edit" onclick="javascript:Order.editPackageDialog('<?php echo HttpUtil::baseUrl();?>',  '<?php echo  $package['id'];; ?>');" /> 
		        	<?php if($package['status'] == 0){ ?>
		        		<input type='button'  value="<?php echo $this->translate("delBtn"); ?>"  id='delete'  name='delete' onclick="javascript:Order.delPackage('<?php echo HttpUtil::baseUrl();?>',  '<?php echo  $package['id']; ?>',  '<?php echo  $orderId; ?>');" />
		        	<?php } ?>
	        	</td> 
		        <?php 
                		} 
                  } 
                ?>   
		     </tr> 
		</table>
	</div> 
    